package com.tuxianchao.springboottask.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * created by
 *
 * @author tuxianchao
 * @date 2018/5/2 下午5:01
 */
@Component
public class TestTask {
    private Logger logger = LoggerFactory.getLogger(TestTask.class);
    private int count = 0;

    @Scheduled(cron = "*/1 * * * * ?")
    private void process() {
        logger.info("\"this is scheduler task runing  \"  " + (count++));
    }
}
